import 'person.dart';

/**
 * @Author: 健聪
 * @Description: 继承
 * @Date: 2024/01/29
 */
void main() {
  // var student = new Student();
  // student.study();
  // student.name = "Tom";
  // student.age = 16;
  //
  // print(student.isAdult);
  // student.run();

  Person person = new Student();
  person.name = "Tom";
  person.age = 18;

  if(person is Student) {
    person.study();
  }
  print(person);

}

class Student extends Person {
  void study() {
    print('学生正在学习');
  }

  @override
  bool get isAdult => age !> 15;

  // @override
  // bool get isAdult {
  //   return age !> 15;
  // }

  @override
  void run() {
    // // TODO: implement run
    // super.run();
    print("Student is running");
  }
}